home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / backup / tob-0.13 / tob-0 / tob / sample-rc / tob.rc.remote-afioz < prev    next >
Text File  |  1995-04-10  |  3KB  |  53 lines

  1. # Resource file for tob (version 0.01 and higher), using afio'd compressed
  2. # archives. Use this resource file if you're backing up to a remote device,
  3. # i.e. across a network.
  4. # See the docs for a full explanation.
  5.  
  6. VERBOSE="yes"
  7. TOBHOME="/usr/etc/tob"
  8.  
  9. # Remote backups are a tat more difficult. Basically, you need to run an rsh
  10. # to access the remote backup device. The procedure goes as follows:
  11. # 1. You run the tob script from the _local_ machine, to a device on the
  12. #    _remote_ machine.
  13. # 2. On the local machine you create a pipe where the backup goes to. The
  14. #    BACKUPDEV setting reflects this pipe. The pipe is created with "mknod".
  15. # 3. Then you start an rsh at the remote machine to read stdin and to dd it to
  16. #    the actual device (e.g. a tape). The rsh may not be started as "root",
  17. #    since rsh prohibits that. So, you need a non-root user at both machines
  18. #    (say "joe"). You feed the rsh the contents of the local pipe. E.g.:
  19. #    su - joe -c "rsh remote dd of=/dev/ftape < /tmp/pipe" &
  20. #                                    ^ cmd in background
  21. #                           ^ gets its input from /tmp/pipe
  22. #           ^ that command is rsh, to do stuff at remote host
  23. #    ^ this thingy is started as user "joe"
  24. # 4. Now on the local machine you can happily run the backup as root to the
  25. #    pipe, the background process will copy as user "joe" the pipe to a remote
  26. #    device using "rsh".
  27. # 5. Once the backup finishes, the pipeline gets EOF'd, thereby automatically
  28. #    terminating the rsh.
  29.  
  30. # backup device on the local machine, must be the pipeline
  31. BACKUPDEV="/tmp/pipe.$$"
  32. # backup device on the remote machine, set to a temporary file
  33. # (change this into something more meaningful)
  34. # the remote host where the actual backup device is
  35. REMOTEHOST="suffix"
  36. REMOTEBACKUPDEV="/tmp/backup.out"
  37. # the user to start the rsh, since this may not be root
  38. RSHUSER="karel"
  39.  
  40. # These should generally be ok, if the above variables are right:
  41. PRECMD1="mknod $BACKUPDEV p ; chmod a+rw $BACKUPDEV"
  42. if [ "$TYPE" = "full" -o "$TYPE" = "diff" -o "$TYPE" = "inc" ] ; then
  43.     # remote command must write to REMOTEBACKUPDEV, local
  44.     # command must read from BACKUPDEV
  45.     PRECMD2='su - $RSHUSER -c "rsh $REMOTEHOST dd of=$REMOTEBACKUPDEV < $BACKUPDEV" &'
  46. else
  47.     # remote command must read from REMOTEBACKUPDEV, local command
  48.     # must write to BACKUPDEV
  49.     PRECMD2='su - $RSHUSER -c "rsh $REMOTEHOST dd if=$REMOTEBACKUPDEV > $BACKUPDEV" &'
  50. fi
  51.  
  52. POSTCMD="echo $BACKUPDEV is now superfluous, remove it when this job finishes"
  53.